package com.xxx.coll;

import java.util.Iterator;
import java.util.LinkedHashSet;

/**
 * @version v1.0
 * @Description:
 * @Author zhanzhongxin
 * @Date 2021/7/21 10:36
 * @Copyright 博为峰
 */
public class LinkedHashSetDemo {
    public static void main(String[] args) {
        /*
           数据结构：链表+hash表
         */
        LinkedHashSet linkedHashSet = new LinkedHashSet();
        linkedHashSet.add("c");
        linkedHashSet.add("a");
        linkedHashSet.add("m");
        linkedHashSet.add("a");
        Iterator iterator = linkedHashSet.iterator();
        while (iterator.hasNext()) {
            String s = (String) iterator.next();
            System.out.println(s);
        }

    }
}
